using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;

namespace TiTi.tea.Model
{
    public partial class TiTiContext : DbContext
    {
        public TiTiContext()
            : base("name=TiTiContext")
        {
        }

        public virtual DbSet<Category> Category { get; set; }
        public virtual DbSet<Coupon> Coupon { get; set; }
        public virtual DbSet<DictInfo> DictInfo { get; set; }
        public virtual DbSet<DictType> DictType { get; set; }
        public virtual DbSet<IntegralsInfo> IntegralsInfo { get; set; }
        public virtual DbSet<LocationInfo> LocationInfo { get; set; }
        public virtual DbSet<LoginInfo> LoginInfo { get; set; }
        public virtual DbSet<Material> Material { get; set; }
        public virtual DbSet<MenuInfo> MenuInfo { get; set; }
        public virtual DbSet<OrderDetail> OrderDetail { get; set; }
        public virtual DbSet<orderinfo> orderinfo { get; set; }
        public virtual DbSet<RoleInfo> RoleInfo { get; set; }
        public virtual DbSet<RoleMenu> RoleMenu { get; set; }
        public virtual DbSet<Sku> Sku { get; set; }
        public virtual DbSet<Spec> Spec { get; set; }
        public virtual DbSet<Spu> Spu { get; set; }
        public virtual DbSet<Template> Template { get; set; }
        public virtual DbSet<UserCoupon> UserCoupon { get; set; }
        public virtual DbSet<UserInfo> UserInfo { get; set; }
        public virtual DbSet<UserRole> UserRole { get; set; }
        public virtual DbSet<Configs> Configs { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Category>()
                .Property(e => e.CatName)
                .IsUnicode(false);

            modelBuilder.Entity<Category>()
                .Property(e => e.Icon)
                .IsUnicode(false);

            modelBuilder.Entity<Coupon>()
                .Property(e => e.Discounts)
                .HasPrecision(18, 0);

            modelBuilder.Entity<Coupon>()
                .Property(e => e.Money)
                .HasPrecision(18, 0);

            modelBuilder.Entity<DictInfo>()
                .Property(e => e.DictName)
                .IsUnicode(false);

            modelBuilder.Entity<DictInfo>()
                .Property(e => e.DictValue)
                .IsUnicode(false);

            modelBuilder.Entity<DictInfo>()
                .Property(e => e.DictDesc)
                .IsUnicode(false);

            modelBuilder.Entity<DictType>()
                .Property(e => e.DictTypeName)
                .IsUnicode(false);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.Contacts)
                .IsUnicode(false);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.Tel)
                .IsUnicode(false);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.Location)
                .IsUnicode(false);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.LocationDetail)
                .IsUnicode(false);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.Latitude)
                .HasPrecision(18, 0);

            modelBuilder.Entity<LocationInfo>()
                .Property(e => e.Longitude)
                .HasPrecision(18, 0);

            modelBuilder.Entity<LoginInfo>()
                .Property(e => e.LoginName)
                .IsUnicode(false);

            modelBuilder.Entity<LoginInfo>()
                .Property(e => e.LoginPwd)
                .IsUnicode(false);

            modelBuilder.Entity<Material>()
                .Property(e => e.MatName)
                .IsUnicode(false);

            modelBuilder.Entity<Material>()
                .Property(e => e.Price)
                .HasPrecision(18, 0);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.GoodName)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.Image)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.MaterialItem)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.SpecItem)
                .IsUnicode(false);

            modelBuilder.Entity<orderinfo>()
                .Property(e => e.Remark)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.SN)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.SkuName)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.ImageUrl)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.ImageUrls)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.CategoryName)
                .IsUnicode(false);

            modelBuilder.Entity<Sku>()
                .Property(e => e.Spec)
                .IsUnicode(false);

            modelBuilder.Entity<Spec>()
                .Property(e => e.SpecName)
                .IsUnicode(false);

            modelBuilder.Entity<Spec>()
                .Property(e => e.Options)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.SpuName)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.Caption)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.ImageUrl)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.ImageUrls)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.Introduction)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.SpecItems)
                .IsUnicode(false);

            modelBuilder.Entity<Spu>()
                .Property(e => e.MaterialItems)
                .IsUnicode(false);

            modelBuilder.Entity<Template>()
                .Property(e => e.TplName)
                .IsUnicode(false);

            modelBuilder.Entity<UserCoupon>()
                .Property(e => e.Discounts)
                .HasPrecision(18, 0);

            modelBuilder.Entity<UserCoupon>()
                .Property(e => e.Money)
                .HasPrecision(18, 0);

            modelBuilder.Entity<UserInfo>()
                .Property(e => e.ProfilePhoto)
                .IsUnicode(false);

            modelBuilder.Entity<Configs>()
                .Property(e => e.IntegralsMoneyRate)
                .HasPrecision(18, 0);
        }
    }
}
